// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:pd_cooldown_example/main.dart';

void main() {
  testWidgets('Verify app loads correctly', (WidgetTester tester) async {
    // Build our app and trigger a frame.
    await tester.pumpWidget(const MaterialApp(
      title: '节流防抖示例',
      home: MyApp(),
    ));

    // Verify that the app bar title is displayed.
    expect(
      find.text('PD Cooldown 示例'),
      findsOneWidget,
    );

    // Verify that the initial message is displayed.
    expect(
      find.text('点击按钮测试防抖节流功能'),
      findsOneWidget,
    );

    // Verify that the core functionality test section is displayed.
    expect(
      find.text('防抖节流核心功能测试'),
      findsOneWidget,
    );
  });
}
